home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1966 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Checking for a file => Does it exist (Help)
  5. Date: Thu, 18 Jan 96 01:10:47 GMT
  6. Organization: none
  7. Message-ID: <821927447snz@genesis.demon.co.uk>
  8. References: <4d9k6fINNnja@faatcrl.faa.gov> <4dc6kq$dja@gryphon.phoenix.net> <613O-oOMnTB@softsite.co.at>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <613O-oOMnTB@softsite.co.at>
  15.            wsog@softsite.co.at "Walter Sommergruber" writes:
  16.  
  17. >What is if the file exists but you have not the right to read it ?
  18.  
  19. Since C has no concept of permissions you're always going to hit this
  20. problem when the environment implements them.
  21.  
  22. >The fopen would fail but the file exists.
  23.  
  24. >I know the non-portable ways with fstat (DOS, Unix) but is there
  25. >a portable way to tell if the file exists ?
  26.  
  27. No. For instance what if the file was in a directory you couldn't inspect?
  28.  
  29. The usual conclusion is that the question 'does a file exist' isn't generally
  30. useful. 'Can I perform such-and-such operation on a file' generally makes
  31. more sense.
  32.  
  33. -- 
  34. -----------------------------------------
  35. Lawrence Kirby | fred@genesis.demon.co.uk
  36. Wilts, England | 70734.126@compuserve.com
  37. -----------------------------------------
  38.